//wheel.txt - A wheel that opens/closes nearby gates.
//Cell 0 - Unused
// Cell 1 - Range of open gates, if left at 0, range is 4
// Cell 2,3 flag to set to one if turned

beginobjectscript; // door lever

variables;

short range = 4;

body;


beginstate INIT_STATE;

	if (get_memory_cell(1) != 0)
		range = get_memory_cell(1);
	break;

beginstate DEAD_STATE;

break;

beginstate START_STATE; 

break;

beginstate USE_STATE;

	broadcast_object_message(range,105);

	if ((get_memory_cell(2) != 0) || (get_memory_cell(3) != 0)) {
		sf(get_memory_cell(2),get_memory_cell(3),1);
		}

	print_str_color("Turn Wheel: You turn the wheel.",2);
	pc_heard_sound(18);
break;
